{include file="../application/admin/view/index/index_base.html" /}
<div class="nav_z clearfix">
			<div class="nav_nav">
			    <ul>
                    <li class="tee kebi"><a href="{:url('admin/Index/index')}">教师工作量</a></li>
                    {if $Think.session.userInfo.admin==1}<li class="tdd "><a href="{:url('admin/Admin/index')}">领导统计表</a></li>
                    {else /} <li class="tee"></li>{/if}
			    </ul>
				<ul>
					<li class="tj"><a href="#"><span class="glyphicon glyphicon-home"></span>首页</a></li>
					<li class="tj"><a href="{:url('admin/Index/index')}"><span class="glyphicon glyphicon-list-alt"></span>获奖统计</a></li>
					<li class="tj"><a href="{:url('admin/Index/index2')}"><span class="glyphicon glyphicon-list-alt"></span>实训统计</a></li>
					<li class="xuanz tj"><a href="{:url('admin/Index/index3')}"><span class="glyphicon glyphicon-list-alt"></span>授课统计</a></li>
					<li class="tj"><a href="{:url('admin/Index/index4')}"><span class="glyphicon glyphicon-list-alt"></span>科研项目统计</a></li>
					<li class="tj"><a href="{:url('admin/Index/index5')}"><span class="glyphicon glyphicon-list-alt"></span>论文发表统计</a></li>
					<li class="tj"><a href="{:url('admin/Index/index6')}"><span class="glyphicon glyphicon-list-alt"></span>培训(出差)统计</a></li>
					<li class="tj"><a href="{:url('admin/Index/index7')}"><span class="glyphicon glyphicon-list-alt"></span>我的数据统计</a></li>
					
				</ul>
			</div>
		</div>
		<div class="nav_z_cont">
			<!-- 授课统计表 -->
			<div class="yc">
				<div class="ss clearfix">
					<form class="xzxueqi form-search" action="{:url('admin/Index/k_search')}" method="get" >
					<select name="term_id" id="xueqi">
						{volist name="tList" id="t"}
							<option value="{$t['id']}">{$t['term']}</option>
						{/volist}
					    <option selected>选择学期</option>
					</select>
					<input type="text" value="" name="search" id="search" placeholder="搜索内容...">
					<button id="xqxl" class="btn btn-default"><span class="glyphicon glyphicon-search"></span></button>
				</form>
				</div>
					<table>
						<tr class="tr1">
							<td colspan="4" style="text-align: left;">授课统计表</td>
							<td colspan="5" style="text-align: right;">
								<button id="xinz"><span class="glyphicon glyphicon-plus"></span>新增</button>
							</td>
						</tr>
						<tr>
							<td>教师</td>
							<td>学期</td>
							<td>班级</td>
							<td>人数</td>
							<td>课程名称</td>
							<td>计划课时</td>
							<td>实际课时</td>
							<td>状态</td>
							<td>操作</td>
						</tr>
						{volist name="chList" id="vo" empty="$empty"}
							<tr>
								{assign name="var" value="$i" /}
								<td>{$vo['username']}</td>
								<td>{$vo['term']}</td>
								<td>{$vo['class_name']}</td>
								<td>{$vo['class_nub']}</td>
								<td class="hidde">{$vo['course_name']}</td>
								<td>{$vo['plan_hour']}</td>
								<td>{$vo['hour']}</td>
								{if condition="$vo['state']==1"}
									<td class="zhuangt">审核中</td>
									<td class="caoz">
										<button type="button" class="btn tijiao" disabled="disabled">提交</button>
										<button type="button" class="bianj btn bianji" disabled="disabled">编辑</button>
										<button type="button" class="btn shanchu" disabled="disabled">删除</button>
									</td>
								{elseif condition="$vo['state']==2"/}
									<td class="yish">已审核</td>
									<td class="caoz">
										<button type="button" class="btn tijiao" disabled="disabled">提交</button>
										<button type="button" class="bianj btn bianji" disabled="disabled">编辑</button>
										<button type="button" class="btn shanchu" onclick='if(confirm("确定删除？")){window.location="{:url('admin/Index/k_del',['id'=> $vo['id']])}"}'>删除</button>
									</td>
								{elseif condition="$vo['state']==3"/}
									<td class="zhuangt">未通过审核</td>
									<td class="caoz">
										<button type="button" class="btn tijiao" disabled="disabled">提交</button>
										<button type="button" class="bianj btn bianji" onclick="k_find({$vo['id']})">编辑</button>
										<button type="button" class="btn shanchu" onclick='if(confirm("确定删除？")){window.location="{:url('admin/Index/k_del',['id'=> $vo['id']])}"}'>删除</button>
									</td>
								{else /}
									<td class="bc">已保存</td>
									<td class="caoz">
										<button type="button" class="btn tijiao" onclick='if(confirm("确定提交？")){window.location="{:url('admin/Index/k_zt',['id'=> $vo['id']])}"}'>提交</button>
										<button type="button" class="bianj btn bianji" onclick="k_find({$vo['id']})">编辑</button>
										<button type="button" class="btn shanchu" onclick='if(confirm("确定删除？")){window.location="{:url('admin/Index/k_del',['id'=> $vo['id']])}"}'>删除</button>
									</td>
								{/if}
							</tr>
						{/volist}
					</table>
					<div class="page">
						{$page}
					</div>
			</div>
		</div>
	</div>
	<!-- 新增窗口 -->
	<div class="box">
	　	<span class="closeBtn glyphicon glyphicon-remove" title="关闭"></span>
		<h2><span class="glyphicon glyphicon-education"></span>新增授课记录</h2>
		<form action="{:url('admin/Index/k_add')}" method="post">
			<input type="hidden" name="user_id" value="{$Think.session.userInfo.id}">
			<input type="hidden" name="state" value="4">
			<p>学期:<select name="term_id">
					{volist name="tList" id="t"}
						<option value="{$t['id']}">{$t['term']}</option>
					{/volist}
				</select>
			</p>
			<p>班级:<select name="class_id" id="">
					{volist name="cList" id="c"}
						<option value="{$c['id']}">{$c['class_name']}</option>
					{/volist}
				</select>
			</p>
			<p>课程名称:<select name="course_id">
					{volist name="cuList" id="cu"}
						<option value="{$cu['id']}">{$cu['course_name']}</option>
					{/volist}
				</select>
			</p>
			<p>计划课时:<input type="text" placeholder="请输入计划课时" name="plan_hour"></p>
			<p>实际课时:<input type="text" name="hour" placeholder="请输入实际课时"></p>
			<p><button type="submit">保存</button><button type="reset">重置</button></p>
		</form>
	</div>
	<!-- 编辑窗口 -->
	<div class="bjbox">
	　	<span class="closeBtn glyphicon glyphicon-remove" title="关闭"></span>
		<h2><span class="glyphicon glyphicon-education"></span>编辑授课项目</h2>
		<form method="post" action="{:url('admin/Index/k_save')}">
			<input type="hidden" name="id" id="id">
			<input type="hidden" name="user_id" id="user_id">
			<input type="hidden" name="state" value="4">
			<p>学期:<select name="term_id" id="term_id">
					{volist name="tList" id="t"}
						<option value="{$t['id']}" {if condition="$t['term']==$t['term']"}selected{/if}>{$t['term']}</option>
					{/volist}
				</select>
			</p>
			<p>班级:<select name="class_id" id="class_id">
					{volist name="cList" id="c"}
						<option value="{$c['id']}" {if condition="$c['class_name']==$c['class_name']"}selected{/if}>{$c['class_name']}</option>
					{/volist}
				</select>
			</p>
			<p>课程名称:<select name="course_id" id="course_id">
					{volist name="cuList" id="cu"}
						<option value="{$cu['id']}">{$cu['course_name']}</option>
					{/volist}
				</select>
			</p>
			<p>计划课时:<input type="text" name="plan_hour" id="plan_hour"></p>
			<p>实际课时:<input type="text" name="hour" id="hour"></p>
			<p><button type="submit">保存</button><button type="reset">重置</button></p>
		</form>
	</div>
</body>
<script>
	function k_find(id){
		var url = "{:url('admin/Index/k_find')}";
		$.get(url,{id:id},
			function(data){
				$('#id').val(data.id);
				$('#user_id').val(data.user_id);
				$('select#term_id').val(data.term_id);
				$('select#class_id').val(data.class_id);
				$('select#course_id').val(data.course_id);
				$('#plan_hour').val(data.plan_hour);
				$('#hour').val(data.hour);
			}				
		);
	}
</script>
</html>